package com.xky.service.impl;

/**
 * 部门管理方法
 */

import com.xky.mapper.DeptMapper;
import com.xky.pojo.Dept;
import com.xky.pojo.UpdateBm;
import com.xky.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper;


    @Override
    public List<Dept> list1() {
        return deptMapper.list1();
    }

    @Override
    public void delete(Integer id) {
        deptMapper.deleteBid(id);
    }

    @Override
    public void add(Dept dept) {
      dept.setCreateTime(LocalDateTime.now());
      dept.setUpdateTime(LocalDateTime.now());
      deptMapper.insert(dept);
    }

    @Override
    public Dept selectid(Integer id) {
      return deptMapper.selectId(id);

    }

    @Override
    public UpdateBm update(UpdateBm updateBm) {
    deptMapper.updatebm(updateBm);
        return updateBm;
    }

}
